home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / CD-ROM Tools / CompactPlayer / Install < prev    next >
Text File  |  1996-09-26  |  15KB  |  372 lines

  1. ; $VER: Install_CompactPlayer 1.6 (8.12.95)
  2. ; Description: Installer script for CompactPlayer
  3.  
  4. ; This Installer script was written to function as the reference ClassAct
  5. ; Installer. When making an Installer for a ClassAct application, please
  6. ; reuse this script as much as possible. In particular, the procedure
  7. ; install-classact was designed to function as a generic ClassAct library
  8. ; installer.
  9. ; The procedure can be called even when the installation archive does
  10. ; not contain a "Classes" directory. In this care it will do absolutely
  11. ; nothing.
  12.  
  13. ; If you have have problems with installing ClassAct on a system using
  14. ; this procedure, please contact Osma.Ahvenlampi@hut.fi.
  15.  
  16. (set cpu (database "cpu"))
  17. (set cpu020 (and (<> cpu "68000") (<> cpu "68010")))
  18. (set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
  19.  
  20. ; ---------------------------------------------------------------------------
  21.  
  22. ; all strings used in this installer script
  23. ; generic strings
  24. (set #nohelp "No help available.")
  25. (set #installing "Installing ")
  26.  
  27. ; application specific strings
  28. (set cpn (getversion "CompactPlayer"))
  29. (set cpv (/ cpn 65536))
  30. (set cpr (- cpn (* cpv 65536))) 
  31. (set #welcome ("This program will install the CompactPlayer CD audio player version %ld.%ld on your system.\n\nIt will also update the ClassAct classes CompactPlayer requires for operation to the latest (provided) versions.\n\nCompactPlayer is freely distributable software. If you like it, please send a small gift to:\n\nOsma Ahvenlampi\nRekipellontie 2 F 55\n00940 Helsinki\nFinland." cpv cpr))
  32. (set #destdir-prompt "Please select the directory where you want CompactPlayer installed.\n(No directory will be created.)")
  33. (set #destdir-help "The CompactPlayer executable will be copied in this directory.")
  34. (set #docs-prompt "Please select the directory where you want CompactPlayer documentation.")
  35. (set #copying-docs "Copying documentation")
  36. (set #fonts-ask "Do you want to install the custom CompactPlayer fonts?\n\nCompactPlayer is fully font sensitive. The main interface has been designed to take very little space, and for that reason two custom fonts are provided.\n\nInstalling these fonts is recommended.\n\nIf you do not install these fonts, CompactPlayer will use the system default fonts.")
  37. (set #fonts-prompt "Please select the directory where fonts should be installed.")
  38. (set #fonts-tooltypes "Setting font tooltypes for CompactPlayer")
  39. (set #descriptors-ask "Do you want to install the CompactPlayer CD descriptors?\n\nCompactPlayer uses the same kind of CD descriptor files as MCDP to remember the titles on the CD. You can now install a set of ready descriptors for a collection of audio CDs and CD-ROMs.\n\nYou can define your own descriptors for unknown CDs within CompactPlayer.")
  40. (set #disksdest-prompt "Where do you want to place the descriptor directory?\n(A directory called \"Disks\" will be created here.)")
  41. (set #copying-disks "Decompressing descriptor archive...\n\nThese descriptors contain the titles of each CD. The name of file is built from the number of tracks and length of the CD.")
  42. (set #path-tooltype "Setting path tooltype for CompactPlayer")
  43. (set #choose-device "Please enter the name of the SCSI device your CD-ROM is connected to.")
  44. (set #choose-unit "Please enter the SCSI unit ID of your CD-ROM device.")
  45. (set #scsi-help "Because CompactPlayer uses the SCSI-Direct protocol to interface with the CD-ROM, it needs to know the SCSI address of the drive. If you are unsure of the device or unit, try one of these:\n\nA2091, A3000, A590: scsi.device\nGVP: gvpscsi.device\nSupra: suprascsi.device\nWarp Engine: warpdrive.device\n\nThe CD-ROM SCSI ID is usually 4 by default.")
  46. (set #scsi-tooltype "Setting the SCSI device and unit")
  47. (set #bye "Please note that the C source to CompactPlayer was not installed by this script.\n\nIf you are a ClassAct developer, it is recommended that you archive the source and this installation script for future reference.")
  48.  
  49. ; ---------------------------------------------------------------------------
  50.  
  51. ; ************* PLEASE COPY THIS PROCEDURE ALONG WITH THE STRINGS IT USES 
  52. ; ************* TO THE INSTALLER SCRIPT OF YOUR CLASSACT APPLICATION.
  53. ; ************* IT WILL TAKE CARE OF INSTALLING THE CLASSACT CLASSES YOU
  54. ; ************* PROVIDED WITH YOUR APPLICATION TO THE USER'S SYSTEM.
  55.  
  56. ; ClassAct installation procedure V 1.4 (23.12.95) by Osma Ahvenlampi
  57.  
  58. ; percentage of the size of included ClassAct classes versus the whole
  59. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  60. (set classact-complete 50)
  61.  
  62. ; ClassAct installer scripts
  63. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  64. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nThis player requires some of the ClassAct classes installed on your system. "
  65.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  66.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  67.         )
  68.     )
  69. )
  70. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  71. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  72. (set #noclasses-message "The directory you selected for your ClassAct classes is not a part of the LIBS: assign.\n\nIt is necessary to add this assign so that the classes will be found properly.")
  73. (set #creating-dir "Creating directory ")
  74. (set #usbackup-prompt "User-Startup will now be backed up.")
  75. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  76. (set #adding-1 "Adding ")
  77. (set #adding-2 " to LIBS: assign\n")
  78. (set #adding-help "This is necessary so that the custom classes can be found.")
  79. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  80. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  81. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  82.  
  83. (procedure install-classact
  84. ; call this procedure to copy the classes included in the Classes directory
  85. ; in your distribution dir.
  86.     (if (exists "Classes") ; The archive contains a ClassAct library update.
  87.     (
  88.         (set comp-dest  (/ (* classact-complete 2) 10))
  89.         (set comp-libs  (/ (* classact-complete 3) 10))
  90.         (set comp-dirs  (/ (* classact-complete 4) 10))
  91.         (set comp-junod (/ (* classact-complete 5) 10))
  92.         (set comp-020   (/ (* classact-complete 6) 10))
  93.         (set comp-gad   (/ (* classact-complete 8) 10))
  94.         (set comp-im    (/ (* classact-complete 9) 10))
  95.     
  96.         ; has the user installed ClassAct in CLASSACT: ?
  97.         (set @classact-dest (getassign "CLASSACT" "A"))
  98.         (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  99.         
  100.         ; is ClassAct already in SYS:Classes ?
  101.         (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  102.                 (= @user-level 2))
  103.             ; no, ask where it should be placed
  104.             (set @classact-dest
  105.                 (askdir
  106.                     (prompt #classdest-prompt)
  107.                     (help #classdest-help)
  108.                     (default @classact-dest)
  109.                     (newpath)
  110.                 )
  111.             )
  112.         )
  113.         
  114.         (complete comp-dest)
  115.         
  116.         (if (<> (run (cat "C/CheckAssign LIBS: " @classact-dest)) 0)
  117.             (
  118.                 (message #noclasses-message)
  119.                 (if (not (exists @classact-dest))
  120.                     (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  121.                 )
  122.                 (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  123.                 (startup "CLASSACT"
  124.                     (command @addassign)
  125.                     (prompt (cat #adding-1 @classact-dest #adding-2))
  126.                     (help #adding-help)
  127.                 )
  128.                 (run (@addassign))
  129.             )
  130.         )
  131.         
  132.         (complete comp-libs)
  133.         
  134.         (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  135.         (set @classact-images (tackon @classact-dest "Images"))
  136.         
  137.         (if (not (exists @classact-gadgets (noreq)))
  138.             (makedir @classact-images
  139.                 (prompt (cat #creating-dir @classact-gadgets))
  140.             )
  141.         )
  142.         
  143.         (if (not (exists @classact-images (noreq)))
  144.             (makedir @classact-images
  145.                 (prompt (cat #creating-dir @classact-images))
  146.             )
  147.         )
  148.         
  149.         (complete comp-dirs)
  150.         
  151.         (if (exists "SYS:Classes/Gadgets/button.gadget")
  152.             (if (< 40 (/ (getversion "SYS:Classes/Gadgets/button.gadget") 65536))
  153.                 (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  154.                     (
  155.                         (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  156.                         (message #junod-backed)
  157.                     )
  158.                     (message #junod-kept)
  159.                 )
  160.             )
  161.         )
  162.         
  163.         (complete comp-junod)
  164.         
  165.         (if (exists "Classes/Gadgets/layout.gadget.020")
  166.             (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default (and cpu020 v39))))
  167.             (set classes-020 0)
  168.         )
  169.  
  170.         (complete comp-020)
  171.         
  172.         (foreach "Classes/Gadgets" "#?.gadget"
  173.             (
  174.                 (set thislib (tackon "Classes/Gadgets" @each-name))
  175.                 (if (and classes-020 (exists (cat thislib ".020")))
  176.                     (set thislib (cat thislib ".020"))
  177.                 )
  178.                 (copylib (source thislib)
  179.                     (dest @classact-gadgets)
  180.                     (newname @each-name)
  181.                     (prompt (cat #installing @each-name))
  182.                     (help #classdest-help)
  183.                     (optional "force" "askuser")
  184.                 )
  185.             )
  186.         )
  187.         
  188.         (complete comp-gad)
  189.         
  190.         (foreach "Classes/Images" "#?.image"
  191.             (
  192.                 (set thislib (tackon "Classes/Images" @each-name))
  193.                 (if (and classes-020 (exists (cat thislib ".020")))
  194.                     (set thislib (cat thislib ".020"))
  195.                 )
  196.                 (copylib (source thislib)
  197.                     (dest @classact-images)
  198.                     (newname @each-name)
  199.                     (prompt (cat #installing @each-name))
  200.                     (help #classdest-help)
  201.                     (optional "force" "askuser")
  202.                 )
  203.             )
  204.         )
  205.         
  206.         (complete comp-im)
  207.  
  208.         (foreach "Classes" "#?.class"
  209.             (
  210.                 (set thislib (tackon "Classes" @each-name))
  211.                 (if (and classes-020 (exists (cat thislib ".020")))
  212.                     (set thislib (cat thislib ".020"))
  213.                 )
  214.                 (copylib (source thislib)
  215.                     (dest @classact-dest)
  216.                     (newname @each-name)
  217.                     (prompt (cat #installing @each-name))
  218.                     (help #classdest-help)
  219.                     (optional "force" "askuser")
  220.                 )
  221.             )
  222.         )
  223.  
  224.         (complete classact-complete)
  225.     )
  226.     )
  227. )
  228.  
  229. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  230. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  231.  
  232. ; ---------------------------------------------------------------------------
  233.  
  234. (complete 0)
  235.  
  236. ; check for OS 2.0
  237. (if (< (/ (getversion "exec.library" (resident)) 65536) 37)
  238.     (abort "This program requires OS 2.04 or better.")
  239. )
  240.  
  241. ; start the ball rolling
  242. (message #welcome)
  243. (welcome)
  244.  
  245. ; install ClassAct
  246. (install-classact)
  247.  
  248. ; ---------------------------------------------------------------------------
  249.  
  250. ; the rest of the script is application-specific.
  251. ; this one installs the executable and docs, asks for some configuration
  252. ; information, and copies the CD descriptions over to some storage dir.
  253.  
  254. (set @default-dest
  255.     (askdir
  256.         (prompt #destdir-prompt)
  257.         (help (cat #destdir-help @askdir-help))
  258.         (default @default-dest)
  259.     )
  260. )
  261.  
  262. (set @docs-dest
  263.     (askdir
  264.         (prompt #docs-prompt)
  265.         (help @askdir-help)
  266.         (default @default-dest)
  267.     )
  268. )
  269.  
  270. (copyfiles
  271.     (source "CompactPlayer")
  272.     (dest @default-dest)
  273.     (prompt #installing "CompactPlayer")
  274.     (infos)
  275. )
  276.  
  277. (complete 60)
  278.  
  279. (if (>= @user-level 1)
  280.     (
  281.         (set scsidevice
  282.             (askstring
  283.             (prompt #choose-device)
  284.             (help #scsi-help)
  285.             (default "scsi.device")
  286.             )
  287.         )
  288.  
  289.         (complete 65)
  290.  
  291.         (set scsiunit
  292.             (askchoice
  293.                 (prompt #choose-unit)
  294.                 (help #scsi-help)
  295.                 (default 4)
  296.                 (choices "0" "1" "2" "3" "4" "5" "6")
  297.             )
  298.         )
  299.         (set scsiunit (cat scsiunit))
  300.     )
  301.     (
  302.         (set scsidevice "scsi.device")
  303.         (set scsiunit "4")
  304.     )
  305. )
  306.  
  307. (tooltype
  308.     (prompt #scsi-tooltype)
  309.     (dest (tackon @default-dest "CompactPlayer"))
  310.     (settooltype "DEVICE" scsidevice)
  311.     (settooltype "UNIT" scsiunit)
  312. )
  313.  
  314. (complete 70)
  315.  
  316. (copyfiles
  317.     (source "CompactPlayer.doc")
  318.     (dest @docs-dest)
  319.     (prompt #copying-docs)
  320.     (infos)
  321. )
  322.  
  323. (complete 75)
  324.  
  325. (if (askbool (prompt #fonts-ask) (help @askbool-help) (default 1))
  326.     (
  327.         (if (= @user-level 2)
  328.             (set @fonts-dest (askdir (prompt #fonts-prompt) (help @askdir-help) (default "FONTS:")))
  329.             (set @fonts-dest "FONTS:")
  330.         )
  331.         (copyfiles (source "Fonts") (dest @fonts-dest) (all))
  332.         (tooltype
  333.             (prompt #fonts-tooltypes)
  334.             (dest (tackon @default-dest "CompactPlayer"))
  335.             (settooltype "TINYFONT" "CompactFont.font/6")
  336.             (settooltype "PANELFONT" "LCD.font/8")
  337.         )
  338.     )
  339. )
  340.  
  341. (complete 80)
  342.  
  343. (if (askbool (prompt #descriptors-ask) (help @askbool-help) (default 1))
  344.     (
  345.         (set @disks-dir
  346.             (askdir
  347.                 (prompt #disksdest-prompt)
  348.                 (help #descriptors-ask)
  349.                 (default @default-dest)
  350.             )
  351.         )
  352.  
  353.         (complete 85)
  354.  
  355.         (working #copying-disks)
  356.         (run (cat "lha x Disks.lha " @disks-dir "/")
  357.             (prompt #copying-disks))
  358.  
  359.         (complete 95)
  360.  
  361.         (tooltype
  362.             (prompt #path-tooltype)
  363.             (dest (tackon @default-dest "CompactPlayer"))
  364.             (settooltype "INDEXPATH" (tackon @disks-dir "Disks"))
  365.         )
  366.     )
  367. )
  368.  
  369. (complete 100)
  370.  
  371. (exit #bye)
  372.